/* 响应式最大宽度设置，适合手机屏幕 */
.max-width-mobile {
    max-width: 540px;
    margin: 0 auto;
}

/* 聊天容器样式 */
.chat-container {
    min-height: 70vh;
    max-height: 70vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 15px !important;
    background-color: #f8f9fa;
    scrollbar-width: thin;
}

/* 自定义滚动条样式 */
.chat-container::-webkit-scrollbar {
    width: 6px;
}

.chat-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.chat-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.chat-container::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* 消息气泡基础样式 */
.message {
    max-width: 75%;
    padding: 12px 15px;
    border-radius: 18px;
    margin-bottom: 8px;
    word-break: break-word;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.3s ease-in-out;
    position: relative;
}

/* 用户消息样式 */
.user-message {
    align-self: flex-end;
    background-color: #0d6efd;
    color: white;
    border-bottom-right-radius: 5px;
}

/* AI消息样式 */
.ai-message {
    align-self: flex-start;
    background-color: #f1f1f1;
    color: #212529;
    border-bottom-left-radius: 5px;
}

/* 自适应文本框 */
.auto-resize {
    min-height: 38px;
    max-height: 200px;
    resize: none;
    overflow-y: hidden;
    padding: 10px 15px;
    border-radius: 20px;
    border: 1px solid #ced4da;
    transition: border-color 0.2s;
}

.auto-resize:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* 发送按钮样式 */
#sendButton {
    border-radius: 20px;
    margin-left: 8px;
    padding: 8px 16px;
}

/* 上传按钮样式 */
#uploadButton {
    border-radius: 20px;
    padding: 8px 16px;
    margin-left: 8px;
}

/* 输入组样式 */
.input-group {
    margin-top: 15px;
    align-items: flex-end;
}

/* 消息容器样式 */
.message-container {
    display: flex;
    justify-content: flex-start;
    width: 100%;
    margin-bottom: 8px;
}

.message-container.user {
    justify-content: flex-end;
}

/* 图片预览容器 */
.image-preview-wrapper {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    border-radius: 10px;
    overflow: hidden;
    background-color: #000;
}

#imagePreview {
    display: block;
    max-height: 200px;
    object-fit: contain;
    margin: 0 auto;
}

#removeImageBtn {
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 24px;
    height: 24px;
}

/* 打字指示器动画 */
.typing-indicator {
    display: inline-block;
}

.typing-indicator::after {
    content: '';
    animation: typingDots 1.5s infinite;
}

/* 链接样式 */
.ai-message a {
    color: #0d6efd;
    text-decoration: underline;
}

.user-message a {
    color: #fff;
    text-decoration: underline;
}

/* Markdown样式 */
.markdown-content {
    font-size: 0.95rem;
    line-height: 1.5;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.markdown-content h1 {
    font-size: 1.5rem;
    border-bottom: 1px solid #eaecef;
    padding-bottom: 0.3rem;
}

.markdown-content h2 {
    font-size: 1.3rem;
    border-bottom: 1px solid #eaecef;
    padding-bottom: 0.2rem;
}

.markdown-content h3 {
    font-size: 1.1rem;
}

.markdown-content ul,
.markdown-content ol {
    padding-left: 2rem;
    margin-bottom: 1rem;
}

.markdown-content li {
    margin-bottom: 0.25rem;
}

.markdown-content p {
    margin-bottom: 1rem;
}

.markdown-content code {
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
    padding: 0.2em 0.4em;
    font-family: SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
    font-size: 85%;
}

.markdown-content pre {
    background-color: #f6f8fa;
    border-radius: 6px;
    padding: 16px;
    overflow: auto;
    margin-bottom: 1rem;
}

.markdown-content pre code {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
    font-size: 0.9rem;
    line-height: 1.45;
    white-space: pre;
}

.markdown-content table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 1rem;
}

.markdown-content table th,
.markdown-content table td {
    border: 1px solid #dfe2e5;
    padding: 6px 13px;
}

.markdown-content table tr:nth-child(2n) {
    background-color: #f6f8fa;
}

.markdown-content blockquote {
    margin: 0 0 1rem;
    padding: 0 1rem;
    color: #6a737d;
    border-left: 0.25rem solid #dfe2e5;
}

/* 图片缩略图和用户上传的图片 */
.thumbnail-image {
    max-width: 200px;
    max-height: 150px;
    border-radius: 10px;
    margin-top: 8px;
    cursor: pointer;
}

.user-uploaded-image {
    max-width: 150px;
    max-height: 120px;
    border-radius: 10px;
    margin-top: 8px;
    display: block;
}

/* 清除历史按钮 */
#clearHistoryBtn {
    border-radius: 50%;
    padding: 0.25rem 0.4rem;
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes typingDots {
    0% { content: '.'; }
    25% { content: '..'; }
    50% { content: '...'; }
    75% { content: '..'; }
    100% { content: '.'; }
}

/* 响应式调整 */
@media (max-width: 576px) {
    .message {
        max-width: 85%;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .chat-container {
        min-height: 65vh;
        max-height: 65vh;
    }
    
    .markdown-content pre {
        max-width: 100%;
        overflow-x: auto;
    }
} 